package com.mxl.service.cashorder.rule;

import java.util.List;

import javax.annotation.Resource;

import com.mxl.common.helper.ResponseErrorCode;
import com.mxl.common.rule.AbstractRule;
import com.mxl.dao.cashorder.impl.ChargeChannelDaoImpl;
import com.mxl.dao.cashorder.model.ChargeChannel;
import com.mxl.service.cashorder.dto.CashOrderRequest;

/**
 * 检查卡渠道是否可用
 * 
 * @author Administrator
 * 
 */
public class CheckCardChannel extends AbstractRule {
	@Resource(name = "chargeChannelDao")
	private ChargeChannelDaoImpl chargeChannelDao;

	protected boolean makeDecision(Object obj) throws Exception {
		CashOrderRequest c = (CashOrderRequest) obj;
//		List<ChargeChannel> channels = chargeChannelDao
//				.queryAvailableChannel(c);
//		if (channels == null || channels.isEmpty()) {
//			c.setMsgId(ResponseErrorCode.CHARGE_CHANNEL_NOT_AVAILABLE.getValue());
//			return false;
//		}
		return true;
	}

}
